'use strict';

import React from 'react';

require('styles/news/NewsDetail.css');

class NewsDetailComponent extends React.Component {
  render() {
  	const {newsDetail}=this.props;
  	var body = newsDetail.body;
  	//console.log("body="+body);
  	var rel=newsDetail.relativies;
  	var relatives=[];
  	if(rel!==undefined && rel!=null){
  		relatives=rel.relative
  	}
    return (
      <div className="full-post">
      	<h1 className="post-title">{newsDetail.title}</h1>
      	<div className="author-details">
      		<span className="author-name">{newsDetail.author}</span>
          <span className="pub-date">{newsDetail.pubDate}</span>
      	</div>
      	<div className="post-content" dangerouslySetInnerHTML={{__html:body}}>
      	</div>
      	<div><span>更多关于&nbsp;</span><span>{newsDetail.softwarename}</span><span>&nbsp;的信息</span></div>
      	<hr/>
  		{
  			relatives.map(item=>
  				<div key={item.rurl}  style={{width:'100%'}}><a href={item.rurl}>{item.rtitle}</a></div>
  				)
  		}
      </div>
    );
  }
}

NewsDetailComponent.displayName = 'NewsNewsDetailComponent';

// Uncomment properties you need
// NewsDetailComponent.propTypes = {};
// NewsDetailComponent.defaultProps = {};

export default NewsDetailComponent;
